#ifndef LOG_GEN_H
#define LOG_GEN_H

#include <QFile>
#include <QDir>

#include <QDate>
#include <QDateTime>
#include <QDebug>

#include "zlgcan.h"

extern uint32_t Realtime_flag;

typedef struct  {
    QDateTime timestamp;
    uint32_t frameId;
    uint8_t frameFormat;  //1-数据帧 2-远程帧
    bool isExtendedFrame;
    QTime dataTimestamp;
    uint8_t data[8];
}S_LogEntry;

// 生成或插入 Log信息到文件
extern QString logPath1;
extern QString logPath2;
extern QString logFileFullPath;

extern void Gen_Insert_LogFile(QString *outext,QString filePath,uint32_t id,uint8_t *data,uint16_t send_flag);
extern int32_t  Read_Loginfo_fromFile(QString FilePath,QString *textLine, uint32_t lineNUm, qint64 *filePosition);
extern bool parseLogLine(const QString &line, S_LogEntry &entry);

#endif // LOG_GEN_H
